<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.1">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"emoh.xyz","root":"/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
  </script>

  <meta name="description" content="常用命令 tmux new 创建默认名称的会话（在tmux命令模式使用new命令可实现同样的功能，其他命令同理，后文不再列出tmux终端命令） tmux new -s mysession 创建名为mysession的会话 tmux ls 显示会话列表 tmux a 连接上一个会话 tmux a -t mysession 连接指定会话 tmux rename -t s1 s2 重命名会话s1为s2">
<meta property="og:type" content="article">
<meta property="og:title" content="tmux快捷键">
<meta property="og:url" content="http://emoh.xyz/2020/06/01/2020-06-01-tmux%E5%BF%AB%E6%8D%B7%E9%94%AE/index.html">
<meta property="og:site_name" content="Just do it!">
<meta property="og:description" content="常用命令 tmux new 创建默认名称的会话（在tmux命令模式使用new命令可实现同样的功能，其他命令同理，后文不再列出tmux终端命令） tmux new -s mysession 创建名为mysession的会话 tmux ls 显示会话列表 tmux a 连接上一个会话 tmux a -t mysession 连接指定会话 tmux rename -t s1 s2 重命名会话s1为s2">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2020-06-01T04:44:58.000Z">
<meta property="article:modified_time" content="2020-06-01T04:47:44.564Z">
<meta property="article:author" content="Emoh">
<meta property="article:tag" content="tmux">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="http://emoh.xyz/2020/06/01/2020-06-01-tmux%E5%BF%AB%E6%8D%B7%E9%94%AE/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>tmux快捷键 | Just do it!</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">Just do it!</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://emoh.xyz/2020/06/01/2020-06-01-tmux%E5%BF%AB%E6%8D%B7%E9%94%AE/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/touxiang.png">
      <meta itemprop="name" content="Emoh">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Just do it!">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          tmux快捷键
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2020-06-01 12:44:58 / 修改时间：12:47:44" itemprop="dateCreated datePublished" datetime="2020-06-01T12:44:58+08:00">2020-06-01</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/vim/" itemprop="url" rel="index"><span itemprop="name">vim</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p>常用命令</p>
<p>tmux new 创建默认名称的会话（在tmux命令模式使用new命令可实现同样的功能，其他命令同理，后文不再列出tmux终端命令）</p>
<p>tmux new -s mysession 创建名为mysession的会话</p>
<p>tmux ls 显示会话列表</p>
<p>tmux a 连接上一个会话</p>
<p>tmux a -t mysession 连接指定会话</p>
<p>tmux rename -t s1 s2 重命名会话s1为s2</p>
<p>tmux kill-session 关闭上次打开的会话</p>
<p>tmux kill-session -t s1 关闭会话s1</p>
<p>tmux kill-session -a -t s1 关闭除s1外的所有会话</p>
<p>tmux kill-server 关闭所有会话</p>
<a id="more"></a>

<p>常用快捷键</p>
<p>prefix s 列出会话，可进行切换</p>
<p>prefix $ 重命名会话</p>
<p>prefix d 分离当前会话</p>
<p>prefix D 分离指定会话</p>
<p>窗口管理</p>
<p>prefix c 创建一个新窗口</p>
<p>prefix , 重命名当前窗口</p>
<p>prefix w 列出所有窗口，可进行切换</p>
<p>prefix n 进入下一个窗口</p>
<p>prefix p 进入上一个窗口</p>
<p>prefix l 进入之前操作的窗口</p>
<p>prefix 0<del>9 选择编号0</del>9对应的窗口</p>
<p>prefix . 修改当前窗口索引编号</p>
<p>prefix ‘ 切换至指定编号（可大于9）的窗口</p>
<p>prefix f 根据显示的内容搜索窗格</p>
<p>prefix &amp; 关闭当前窗口</p>
<p>窗格管理</p>
<p>prefix % 水平方向创建窗格</p>
<p>prefix “ 垂直方向创建窗格</p>
<p>prefix Up|Down|Left|Right 根据箭头方向切换窗格</p>
<p>prefix q 显示窗格编号</p>
<p>prefix o 顺时针切换窗格</p>
<p>prefix } 与下一个窗格交换位置</p>
<p>prefix { 与上一个窗格交换位置</p>
<p>prefix x 关闭当前窗格</p>
<p>prefix space(空格键) 重新排列当前窗口下的所有窗格</p>
<p>prefix ! 将当前窗格置于新窗口</p>
<p>prefix Ctrl+o 逆时针旋转当前窗口的窗格</p>
<p>prefix t 在当前窗格显示时间</p>
<p>prefix z 放大当前窗格(再次按下将还原)</p>
<p>prefix i 显示当前窗格信息</p>
<p>其他命令</p>
<p>tmux list-key 列出所有绑定的键，等同于prefix ?</p>
<p>tmux list-command 列出所有命令 </p>
<p>-–</p>
<p>1）进入tmux面板后，一定要先按ctrl+b，然后松开，再按其他的组合键才生效。</p>
<p>2）常用到的几个组合键：</p>
<p>ctrl+b ?            显示快捷键帮助</p>
<p>ctrl+b 空格键       采用下一个内置布局，这个很有意思，在多屏时，用这个就会将多有屏幕竖着展示</p>
<p>ctrl+b !            把当前窗口变为新窗口</p>
<p>ctrl+b  “           模向分隔窗口</p>
<p>ctrl+b %            纵向分隔窗口</p>
<p>ctrl+b q            显示分隔窗口的编号</p>
<p>ctrl+b o            跳到下一个分隔窗口。多屏之间的切换</p>
<p>ctrl+b 上下键      上一个及下一个分隔窗口</p>
<p>ctrl+b C-方向键    调整分隔窗口大小</p>
<p>ctrl+b &amp;           确认后退出当前tmux</p>
<p>ctrl+b [           复制模式，即将当前屏幕移到上一个的位置上，其他所有窗口都向前移动一个。</p>
<p>ctrl+b c           创建新窗口</p>
<p>ctrl+b n           选择下一个窗口</p>
<p>ctrl+b l           最后使用的窗口</p>
<p>ctrl+b p           选择前一个窗口</p>
<p>ctrl+b w           以菜单方式显示及选择窗口</p>
<p>ctrl+b s           以菜单方式显示和选择会话。这个常用到，可以选择进入哪个tmux</p>
<p>ctrl+b t           显示时钟。然后按enter键后就会恢复到shell终端状态</p>
<p>ctrl+b d           脱离当前会话；这样可以暂时返回Shell界面，输入tmux attach能够重新进入之前的会话</p>

    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/tmux/" rel="tag"># tmux</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2020/06/01/2020-06-01-vimplus%E5%BF%AB%E6%8D%B7%E9%94%AE/" rel="prev" title="vimplus快捷键">
      <i class="fa fa-chevron-left"></i> vimplus快捷键
    </a></div>
      <div class="post-nav-item">
    <a href="/2020/06/03/2020-06-03-syslog%E9%85%8D%E7%BD%AE/" rel="next" title="2020-06-03-syslog配置">
      2020-06-03-syslog配置 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="Emoh"
      src="/images/touxiang.png">
  <p class="site-author-name" itemprop="name">Emoh</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">29</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">16</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">23</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Emoh</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> 强力驱动
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  















  

  

</body>
</html>
